<template>
  
   <el-table
      ref="multipleTable"
      :data="arr"
      style="width: 100%">
      <el-table-column
        label="编号"
        width="80">
      <template  slot-scope="scope">{{scope.row.number.number}}</template>
      </el-table-column>
       <el-table-column
        prop="name"
        label="用户名" >
        <template></template>
      </el-table-column>
      <el-table-column
        prop="Personnelnumbers"
        label="人员编号">
        <template  slot-scope="scope">{{scope.row.Personnelnumbers.number}}</template>
      </el-table-column>
     
      <el-table-column
       label="所属角色">
        <template slot-scope="scope"> {{ powerObj[scope.row.power] }}</template>
      </el-table-column>
      <el-table-column
        label="说明" >
         <!-- slot scope 作用域插槽 template空标签 scope.row当前行数据 -->
        <template slot-scope="scope"> {{ typeObj[scope.row.type] }}</template>
      </el-table-column>
      <el-table-column
        prop="newdate"
        label="新建时间"
       ><template  slot-scope="scope">{{scope.row.newdate}}</template>
      </el-table-column>
      <el-table-column
        prop="effect"
        label="是否有效"
      ><template  slot-scope="scope">{{ effectObj[scope.row.effect]}}</template>
      </el-table-column>

      
      <el-table-column
        prop="operation"
        label="操作">
        <template  slot-scope="scope">
      <i  class="el-icon-edit" 
      style="color:#5e66e3"  
      @click="handleEdit(scope.row)"></i>
      <span>修改</span>
      <i  class="el-icon-delete" style="color:#5e66e3" @click="add(scope.row.id)"></i><span>删除</span>
      <i  class="el-icon-refresh-right" style="color:#5e66e3" @click="handleDelete(scope.row.id)"></i><span>重置密码</span>
        </template>
      </el-table-column>
    </el-table>
    
</template>

<script>

import {deleteHomeApi} from '@/api/cmthomeApi'
 export default {
      props:['arr'],
      data() {
        return {
          powerObj:{
             0:'管理员',
             1:'街道负责人',
          },
          typeObj:{
              0:'该账号拥有所有权限',
              1:'上传车位信息'
          },
          effectObj:{
              0:'是',
              1:'否'
          },
          // tableData: [{
          //   number:'1',
          //   name:'张三',
          //   Personnelnumbers:'',
          //   power:'0',
          //   type:'0',
          //   newdate:'',
          //   effect:'',
          //   operation:'',


          // }
          
        //  ],
           multipleSelection:[],
        }
        
      },
      // mounted(){
      //   this.initCmtView()
      // },
      methods:{
        add(id){
          deleteHomeApi({id:id}).then(res=>{
           this.$emit("resetHome")
            
          })
         
        },
      handleEdit(row){
          this.$emit("doing",row)

         }
      

        
      }

    }
</script>

<style lang="less" scoped>
 

</style>